import { Component, OnInit } from '@angular/core';
import { Catalogue } from '../book-catalogue-component/model/catalogues-model';
import { catalogueService } from '../book-catalogue-component/model/catalogueService/catalogueService';

@Component({
    // moduleId:module.id,
    selector: 'my-dashboard',
    templateUrl:'dashboard.component.html',
    styleUrls:['dashboard.component.scss'],
    // template: '<h3>My Dashboard</h3>'
    providers:[catalogueService]
})
export class DashboardComponent implements OnInit {
    catalogues: Catalogue[];
    constructor(private bookcat: catalogueService,
                ) {
    }

    ngOnInit() {
        this.bookcat.getCatalogues()
            .then(catalogues => this.catalogues = catalogues.slice(1,5));
        // this.bookcatalogues = this.bookcat.getCatalogues();

    }
}